package Exceptions;

public class HttpNodeClientException extends Exception{

		private static final long serialVersionUID = 1L;
		private String mistake;
		private String errorMessage;
		//----------------------------------------------
		// Default constructor - initializes instance variable to unknown
		  public HttpNodeClientException()
		  {
		    super();             // call superclass constructor
		    mistake = "unknown";
		    errorMessage = "";
		  }
		  
		public String getErrorMessage() {
			return errorMessage;
		}

		//-----------------------------------------------
		// Constructor receives some kind of message that is saved in an instance variable.
		  public HttpNodeClientException(String err)
		  {
		    super(err);     // call super class constructor
		    mistake = err;  // save message
		    errorMessage = "";
		  }
		  public HttpNodeClientException(String err, String errorMes)
		  {
		    super(err);     // call super class constructor
		    mistake = err;  // save message
		    errorMessage = errorMes;
		  }
		//------------------------------------------------  
		// public method, callable by exception catcher. It returns the error message.
		  public String getError()
		  {
		    return mistake;
		  }
		}


		  




